log1p
Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero.
log1p()
returns log(1+ number )
, and the accurate result can be calculated even when the value of number is close to zero.
Returns the log(1+ number ) of different values. Calculation result:
<?php echo ( log1p ( 2.7183 ) ) ; echo ( log1p ( 2 ) ) ; echo ( log1p ( 1 ) ) ; echo ( log1p ( 0 ) ) ; ?>
Try it yourself
log1p ( x )
parameter | describe |
---|---|
x | Required. A number. |
Warning: This function is experimental. The behavior of this function, including function name and any other documentation about this function, may change with subsequent releases by PHP without notification. Use of this function at your own risk.